package cn.xdmnb.cloud.blog.core.model;

import java.util.List;

/**
 * @author yukai
 * @since 2023年01月05日 15:55
 */
public class PageData<T> {

    private long total;

    private  int pages;

    private List<T> result;

    public static <T> PageData<T> getInstance(List<T> res){
        PageData<T> data = new PageData<>();
        data.setTotal(res.size());
        data.setPages(1);
        data.setResult(res);
        return data;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }

    public List<T> getResult() {
        return result;
    }

    public void setResult(List<T> result) {
        this.result = result;
    }
}
